//
//  LSZProblemContentTableViewCell.m
//  PartyClassCloud
//
//  Created by 梁素珍 on 2018/9/5.
//  Copyright © 2018年 九酷. All rights reserved.
//

#import "LSZProblemContentTableViewCell.h"

@implementation LSZProblemContentTableViewCell

-(id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.imageViewHeader = [[UIImageView alloc]init];
        self.imageViewHeader.frame = CGRectMake(20, 10, 40, 40);
        [self.imageViewHeader.layer setMasksToBounds:YES];
        [self.imageViewHeader.layer setCornerRadius:self.imageViewHeader.frame.size.height/2];
        [self addSubview:self.imageViewHeader];
        
        self.labelName = [[UILabel alloc]init];
        self.labelName.textColor = lightColor;
        self.labelName.font = FONT_(17);
        self.labelName.frame = CGRectMake(CGRectGetMaxX(self.imageViewHeader.frame)+10, CGRectGetMinY(self.imageViewHeader.frame), ScreenWidth/2, 22);
        [self addSubview:self.labelName];
        
        self.labelTime = [[UILabel alloc]init];
        self.labelTime.textColor = lightColor;
        self.labelTime.font = FONT_(13);
        self.labelTime.frame = CGRectMake(CGRectGetMaxX(self.imageViewHeader.frame)+10, CGRectGetMaxY(self.imageViewHeader.frame)-17,ScreenWidth/2, 17);
        [self addSubview:self.labelTime];
        
        self.butState = [[UIButton alloc]init];
        self.butState.frame = CGRectMake(ScreenWidth-20-60, CGRectGetMinY(self.imageViewHeader.frame), 60, 40);
        self.butState.hidden = YES;
        self.butState.backgroundColor = themeColor;
        [self.butState setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
        [self addSubview:self.butState];
        
        self.labelTitle = [[UILabel alloc]init];
        self.labelTitle.textColor = titleColorLSZ;
        self.labelTitle.font = FONT_(15);
        self.labelTitle.numberOfLines = 0;
        self.labelTitle.frame = CGRectMake(CGRectGetMaxX(self.imageViewHeader.frame)+10, CGRectGetMaxY(self.imageViewHeader.frame)+10, ScreenWidth-20-CGRectGetMaxX(self.imageViewHeader.frame), 30);
        [self addSubview:self.labelTitle];
    }
    return self;
}
-(void)setMutualProblemMg:(LSZMutualProblemMg *)MutualProblemMg
{
    CGFloat height = [LSZSpecialPackaging getHeightOfText:ScreenWidth-80 height:ScreenHeight font:15 :MutualProblemMg.content];
    [self.imageViewHeader sd_setImageWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"%@",MutualProblemMg.headUrl]] placeholderImage:[UIImage imageNamed:@"默认"]];
    self.labelName.text = MutualProblemMg.customerName;
    self.labelTime.text = MutualProblemMg.publishTime;
    self.labelTitle.text = MutualProblemMg.content;
    CGRect frame = self.labelTitle.frame;
    frame.size.height = height;
    self.labelTitle.frame = frame;
}
-(void)setQuestionParticipantDetailsInterfaceMg:(LSZQuestionParticipantDetailsInterfaceMg *)QuestionParticipantDetailsInterfaceMg
{
    CGFloat height = [LSZSpecialPackaging getHeightOfText:ScreenWidth-80 height:ScreenHeight font:15 :QuestionParticipantDetailsInterfaceMg.content];
    [self.imageViewHeader sd_setImageWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"%@",QuestionParticipantDetailsInterfaceMg.headUrl]] placeholderImage:[UIImage imageNamed:@"默认"]];
    self.labelName.text = QuestionParticipantDetailsInterfaceMg.realName;
    self.labelTime.text = QuestionParticipantDetailsInterfaceMg.publishTime;
    self.labelTitle.text = QuestionParticipantDetailsInterfaceMg.content;
    CGRect frame = self.labelTitle.frame;
    frame.size.height = height;
    self.labelTitle.frame = frame;
}
@end
